package util.AST.Comando;

import java.util.ArrayList;

import util.AST.Terminal.Valor;

public class Print extends ComandoSimples{
	
	private ArrayList<Valor> valores;
	private Valor valor;
	
	public Print(ArrayList<Valor> valores, Valor valor){
		this.valores = valores;
		this.valor = valor;
	}
	
	@Override
	public String toString(int level) {
		int nextLevel = level+5;
		StringBuffer string = new StringBuffer();
		string.append("print\n");
		if(this.valores != null){
			for(Valor valor:this.valores){
				string.append(super.getSpaces(nextLevel) + "|-" + valor.toString(nextLevel));
			}
		}else if(this.valor != null){
			string.append(super.getSpaces(nextLevel) + "|-" + valor.toString(nextLevel));
		}
		return string.toString();
	}
	
}
